package com.fig.spring.beans;

import org.springframework.beans.factory.FactoryBean;

/**
 * @Description:
 * @Author: Flynn Vanderboom
 * @Data: 2021/4/12 19:49
 */

/***
 * 区别:
 * 1.Person = 普通Bean，注册的组件对象就是Person对象，类型就是Person
 * 2.工厂Bean=实现FactoryBean接口组件。注册的不是HelloFactory，而是HelloFactory这个工厂调用了
 * 	 getObject()的返回对象，类型是getObjectType
 *
 * 	 MyBatis和Spring的整合SqlSessionFactoryBean
 */

public class HelloFactory implements FactoryBean<Hello> {

	@Override
	public Hello getObject() throws Exception {
		return new Hello();
	}

	@Override
	public Class<?> getObjectType() {
		return Hello.class;
	}
}
